<template>
    <div id="footer-nav">
        <!-- 底部登录区 -->
        <ul class="footer-list">
            <li class="list-login "><a>登录</a></li>
            <li class="list-register "><a> 注册</a></li>
            <li class="back-top"  @click="backTop()"><i></i>返回顶部</li>
        </ul>
    </div>
</template>
<script>
    export default{
        name:'Footernav',
        mounted() {//可以在这里面直接进行滚动条的获取
            // window.addEventListener('scroll', this.handleScroll, true)
        },
        methods: {
            handleScroll() {
            //方法一
            var top = Math.floor(document.body.scrollTop || document.documentElement.scrollTop || window.pageXOffset)
            console.log(top)
            },
            backTop(){
                var tt=window.pageYOffset;
                window.pageYOffset=0+"px";
                console.log(tt)
            },
        }
    }
</script>
<style scoped>
    .footer-list {
  width: 100%;
  height: 40px;
  display: flex;
  margin-top: 20px;
  border-top: 1px solid gray;
}
.footer-list li {
  flex: 1;
  box-sizing: border-box;
  float: left;
  font-size: 14px;
  border-right: 1px solid #c4c4c4;
  text-align: center;
  line-height: 40px;
}
.footer-list .active-color {
  background: #09d0f3;
}
</style>